package com.news.yp.baselibrary.navigationbottom.iterator;

import com.news.yp.baselibrary.navigationbottom.BottomTabItem;

import java.util.ArrayList;
import java.util.List;

public class TabListIterator<T extends BottomTabItem> implements TabItertor {
    private List<T> mTabItems;
    private int index;

    public TabListIterator() {
        mTabItems = new ArrayList<>();
    }

    public void addItem(T item) {
        mTabItems.add(item);
    }

    @Override
    public BottomTabItem next() {
        return mTabItems.get(index++);
    }

    @Override
    public boolean hasNext() {
        return index < mTabItems.size();
    }
}
